From patchwork Thu Jul 20 00:42:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 705220 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14681C001DC for ; Thu, 20 Jul 2023 00:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229574AbjGTApi (ORCPT ); Wed, 19 Jul 2023 20:45:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGTAph (ORCPT ); Wed, 19 Jul 2023 20:45:37 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8F371BF7; Wed, 19 Jul 2023 17:45:33 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fd32e611e0so404358e87.0; Wed, 19 Jul 2023 17:45:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689813932; x=1690418732; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bf+cq0KOQ6B5uZI8TM4cRLer265iTJeb9lwKk3HU/qo=; b=Nh0zEjt+CICrDeh2uQ8F3vyGb7Ik5UzqqU6LzNJN6aWqKiSCYdfKTUBJC77jU85nuX eky02TmZzCk26Qdwxoldz3zYAj0W469fU+oaZYrP4Kkx+lb67bWGIKgXkaNQTRkkAWiI ej7QgQhcgXRAzHPNR8a2Q1XzmW494kWjZHT9Ckn+OZjPUGDPFvjXaaO0OFWujmGizO0D Zi8uJzHoaI/BTupZ9LRFNfsD9LKG5j8tcLXl5ItyU0mlmzulChLVKFTLCcnqbvfE3hHd mUkRkkaSi24QPzDpLWp2qm/lNyZeKzTKr+2LOIgj7LrpwmmXECve2vgBsoRDJl8cHbqw rkWg== X-Gm-Message-State: ABy/qLb0jHiN1MDIkWZ7ZeTFXanDRso3JyHF2OC5fGpTl5utXgo5cmZq 4KhZScVlQU+jWeYAJBA9RTb4lQbENPTLAfCB X-Google-Smtp-Source: APBJJlEoVYFMXCPEk3kx9Dz276ceKp4MUEciSuUrW3KTgHTVKF7dgUrMZ5oU3ZGtHY6uDqPTGFV1+g== X-Received: by 2002:a05:6512:1593:b0:4f8:6ac4:1aa9 with SMTP id bp19-20020a056512159300b004f86ac41aa9mr398056lfb.21.1689813931806; Wed, 19 Jul 2023 17:45:31 -0700 (PDT) Received: from flawful.org (c-f5f0e255.011-101-6d6c6d3.bbcust.telenor.se. [85.226.240.245]) by smtp.gmail.com with ESMTPSA id x20-20020ac25dd4000000b004fddd638cecsm9050lfq.89.2023.07.19.17.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 17:45:31 -0700 (PDT) Received: by flawful.org (Postfix, from userid 112) id 97FF43F10; Thu, 20 Jul 2023 02:45:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813930; bh=djK1c+XScXXsMYC+D41Ymb/KysvO005rEBilmbSc9XQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fOc2KAkxxw5NxghKmJqWEhLFOkJmvFDgXJnQUubA2BM2A+uGCnOBa4TTwtsgKtgYK OthqP39Ri1oP9H/mNuosvwb0jlq99p1nnJpIQ2pnBGI+dFYGYrjhKKa0nkWmGLpEtC acHdwCfO2QFs9l3LU/GkVqjJrD6bUmydSS3VEstY= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id 3FF553EF1; Thu, 20 Jul 2023 02:44:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813844; bh=djK1c+XScXXsMYC+D41Ymb/KysvO005rEBilmbSc9XQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ea/l/7e+s5dWQHJirqYWUKFPFoC22cM8GYQuwO3Sqqqgzoa8HdpuGJ4MmJrFODCQQ 6Rt4uLkwXZLvq2Z9lAu6Em9XK+HbocxK5v2mC6zK/lusSQqo4rXpEQ18mdM0s888J+ hITRchnE6nMSMdEghSdH5cDjjJoKjfYdtxRzlpj8= From: Niklas Cassel To: Damien Le Moal Cc: Hannes Reinecke , John Garry , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke , Niklas Cassel Subject: [PATCH v2 1/8] ata: remove reference to non-existing error_handler() Date: Thu, 20 Jul 2023 02:42:42 +0200 Message-ID: <20230720004257.307031-2-nks@flawful.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720004257.307031-1-nks@flawful.org> References: <20230720004257.307031-1-nks@flawful.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Hannes Reinecke With commit 65a15d6560df ("scsi: ipr: Remove SATA support") all libata drivers now have the error_handler() callback provided, so we can stop checking for non-existing error_handler callback. Signed-off-by: Hannes Reinecke [niklas: fixed review comments, rebased, solved conflicts during rebase, fixed bug that unconditionally dumped all QCs, removed the now unused function ata_dump_status(), removed the now unreachable failure paths in atapi_qc_complete(), removed the non-EH function to request ATAPI sense] Signed-off-by: Niklas Cassel --- drivers/ata/libata-core.c | 209 +++++++++++++++----------------------- drivers/ata/libata-eh.c | 150 ++++++++++++--------------- drivers/ata/libata-sata.c | 7 +- drivers/ata/libata-scsi.c | 142 ++------------------------ drivers/ata/libata-sff.c | 30 ++---- 5 files changed, 166 insertions(+), 372 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d37ab6087f2f..1f0306522649 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -1586,13 +1586,11 @@ static unsigned ata_exec_internal_sg(struct ata_device *dev, } } - if (ap->ops->error_handler) - ata_eh_release(ap); + ata_eh_release(ap); rc = wait_for_completion_timeout(&wait, msecs_to_jiffies(timeout)); - if (ap->ops->error_handler) - ata_eh_acquire(ap); + ata_eh_acquire(ap); ata_sff_flush_pio_task(ap); @@ -1607,10 +1605,7 @@ static unsigned ata_exec_internal_sg(struct ata_device *dev, if (qc->flags & ATA_QCFLAG_ACTIVE) { qc->err_mask |= AC_ERR_TIMEOUT; - if (ap->ops->error_handler) - ata_port_freeze(ap); - else - ata_qc_complete(qc); + ata_port_freeze(ap); ata_dev_warn(dev, "qc timeout after %u msecs (cmd 0x%x)\n", timeout, command); @@ -4874,126 +4869,103 @@ static void ata_verify_xfer(struct ata_queued_cmd *qc) void ata_qc_complete(struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; + struct ata_device *dev = qc->dev; + struct ata_eh_info *ehi = &dev->link->eh_info; /* Trigger the LED (if available) */ ledtrig_disk_activity(!!(qc->tf.flags & ATA_TFLAG_WRITE)); - /* XXX: New EH and old EH use different mechanisms to - * synchronize EH with regular execution path. - * - * In new EH, a qc owned by EH is marked with ATA_QCFLAG_EH. - * Normal execution path is responsible for not accessing a - * qc owned by EH. libata core enforces the rule by returning NULL - * from ata_qc_from_tag() for qcs owned by EH. + /* + * In order to synchronize EH with the regular execution path, a qc that + * is owned by EH is marked with ATA_QCFLAG_EH. * - * Old EH depends on ata_qc_complete() nullifying completion - * requests if ATA_QCFLAG_EH_SCHEDULED is set. Old EH does - * not synchronize with interrupt handler. Only PIO task is - * taken care of. + * The normal execution path is responsible for not accessing a qc owned + * by EH. libata core enforces the rule by returning NULL from + * ata_qc_from_tag() for qcs owned by EH. */ - if (ap->ops->error_handler) { - struct ata_device *dev = qc->dev; - struct ata_eh_info *ehi = &dev->link->eh_info; - - if (unlikely(qc->err_mask)) - qc->flags |= ATA_QCFLAG_EH; + if (unlikely(qc->err_mask)) + qc->flags |= ATA_QCFLAG_EH; - /* - * Finish internal commands without any further processing - * and always with the result TF filled. - */ - if (unlikely(ata_tag_internal(qc->tag))) { - fill_result_tf(qc); - trace_ata_qc_complete_internal(qc); - __ata_qc_complete(qc); - return; - } + /* + * Finish internal commands without any further processing and always + * with the result TF filled. + */ + if (unlikely(ata_tag_internal(qc->tag))) { + fill_result_tf(qc); + trace_ata_qc_complete_internal(qc); + __ata_qc_complete(qc); + return; + } - /* - * Non-internal qc has failed. Fill the result TF and - * summon EH. - */ - if (unlikely(qc->flags & ATA_QCFLAG_EH)) { - fill_result_tf(qc); - trace_ata_qc_complete_failed(qc); - ata_qc_schedule_eh(qc); - return; - } + /* Non-internal qc has failed. Fill the result TF and summon EH. */ + if (unlikely(qc->flags & ATA_QCFLAG_EH)) { + fill_result_tf(qc); + trace_ata_qc_complete_failed(qc); + ata_qc_schedule_eh(qc); + return; + } - WARN_ON_ONCE(ata_port_is_frozen(ap)); + WARN_ON_ONCE(ata_port_is_frozen(ap)); - /* read result TF if requested */ - if (qc->flags & ATA_QCFLAG_RESULT_TF) - fill_result_tf(qc); + /* read result TF if requested */ + if (qc->flags & ATA_QCFLAG_RESULT_TF) + fill_result_tf(qc); - trace_ata_qc_complete_done(qc); + trace_ata_qc_complete_done(qc); + /* + * For CDL commands that completed without an error, check if we have + * sense data (ATA_SENSE is set). If we do, then the command may have + * been aborted by the device due to a limit timeout using the policy + * 0xD. For these commands, invoke EH to get the command sense data. + */ + if (qc->result_tf.status & ATA_SENSE && + ((ata_is_ncq(qc->tf.protocol) && + dev->flags & ATA_DFLAG_CDL_ENABLED) || + (!(ata_is_ncq(qc->tf.protocol) && + ata_id_sense_reporting_enabled(dev->id))))) { /* - * For CDL commands that completed without an error, check if - * we have sense data (ATA_SENSE is set). If we do, then the - * command may have been aborted by the device due to a limit - * timeout using the policy 0xD. For these commands, invoke EH - * to get the command sense data. + * Tell SCSI EH to not overwrite scmd->result even if this + * command is finished with result SAM_STAT_GOOD. */ - if (qc->result_tf.status & ATA_SENSE && - ((ata_is_ncq(qc->tf.protocol) && - dev->flags & ATA_DFLAG_CDL_ENABLED) || - (!(ata_is_ncq(qc->tf.protocol) && - ata_id_sense_reporting_enabled(dev->id))))) { - /* - * Tell SCSI EH to not overwrite scmd->result even if - * this command is finished with result SAM_STAT_GOOD. - */ - qc->scsicmd->flags |= SCMD_FORCE_EH_SUCCESS; - qc->flags |= ATA_QCFLAG_EH_SUCCESS_CMD; - ehi->dev_action[dev->devno] |= ATA_EH_GET_SUCCESS_SENSE; - - /* - * set pending so that ata_qc_schedule_eh() does not - * trigger fast drain, and freeze the port. - */ - ap->pflags |= ATA_PFLAG_EH_PENDING; - ata_qc_schedule_eh(qc); - return; - } + qc->scsicmd->flags |= SCMD_FORCE_EH_SUCCESS; + qc->flags |= ATA_QCFLAG_EH_SUCCESS_CMD; + ehi->dev_action[dev->devno] |= ATA_EH_GET_SUCCESS_SENSE; - /* Some commands need post-processing after successful - * completion. + /* + * set pending so that ata_qc_schedule_eh() does not trigger + * fast drain, and freeze the port. */ - switch (qc->tf.command) { - case ATA_CMD_SET_FEATURES: - if (qc->tf.feature != SETFEATURES_WC_ON && - qc->tf.feature != SETFEATURES_WC_OFF && - qc->tf.feature != SETFEATURES_RA_ON && - qc->tf.feature != SETFEATURES_RA_OFF) - break; - fallthrough; - case ATA_CMD_INIT_DEV_PARAMS: /* CHS translation changed */ - case ATA_CMD_SET_MULTI: /* multi_count changed */ - /* revalidate device */ - ehi->dev_action[dev->devno] |= ATA_EH_REVALIDATE; - ata_port_schedule_eh(ap); - break; + ap->pflags |= ATA_PFLAG_EH_PENDING; + ata_qc_schedule_eh(qc); + return; + } - case ATA_CMD_SLEEP: - dev->flags |= ATA_DFLAG_SLEEPING; + /* Some commands need post-processing after successful completion. */ + switch (qc->tf.command) { + case ATA_CMD_SET_FEATURES: + if (qc->tf.feature != SETFEATURES_WC_ON && + qc->tf.feature != SETFEATURES_WC_OFF && + qc->tf.feature != SETFEATURES_RA_ON && + qc->tf.feature != SETFEATURES_RA_OFF) break; - } - - if (unlikely(dev->flags & ATA_DFLAG_DUBIOUS_XFER)) - ata_verify_xfer(qc); + fallthrough; + case ATA_CMD_INIT_DEV_PARAMS: /* CHS translation changed */ + case ATA_CMD_SET_MULTI: /* multi_count changed */ + /* revalidate device */ + ehi->dev_action[dev->devno] |= ATA_EH_REVALIDATE; + ata_port_schedule_eh(ap); + break; - __ata_qc_complete(qc); - } else { - if (qc->flags & ATA_QCFLAG_EH_SCHEDULED) - return; + case ATA_CMD_SLEEP: + dev->flags |= ATA_DFLAG_SLEEPING; + break; + } - /* read result TF if failed or requested */ - if (qc->err_mask || qc->flags & ATA_QCFLAG_RESULT_TF) - fill_result_tf(qc); + if (unlikely(dev->flags & ATA_DFLAG_DUBIOUS_XFER)) + ata_verify_xfer(qc); - __ata_qc_complete(qc); - } + __ata_qc_complete(qc); } EXPORT_SYMBOL_GPL(ata_qc_complete); @@ -5039,11 +5011,8 @@ void ata_qc_issue(struct ata_queued_cmd *qc) struct ata_link *link = qc->dev->link; u8 prot = qc->tf.protocol; - /* Make sure only one non-NCQ command is outstanding. The - * check is skipped for old EH because it reuses active qc to - * request ATAPI sense. - */ - WARN_ON_ONCE(ap->ops->error_handler && ata_tag_valid(link->active_tag)); + /* Make sure only one non-NCQ command is outstanding. */ + WARN_ON_ONCE(ata_tag_valid(link->active_tag)); if (ata_is_ncq(prot)) { WARN_ON_ONCE(link->sactive & (1 << qc->hw_tag)); @@ -5917,15 +5886,9 @@ void __ata_port_probe(struct ata_port *ap) int ata_port_probe(struct ata_port *ap) { - int rc = 0; - - if (ap->ops->error_handler) { - __ata_port_probe(ap); - ata_port_wait_eh(ap); - } else { - rc = ata_bus_probe(ap); - } - return rc; + __ata_port_probe(ap); + ata_port_wait_eh(ap); + return 0; } @@ -6130,9 +6093,6 @@ static void ata_port_detach(struct ata_port *ap) struct ata_link *link; struct ata_device *dev; - if (!ap->ops->error_handler) - goto skip_eh; - /* tell EH we're leaving & flush EH */ spin_lock_irqsave(ap->lock, flags); ap->pflags |= ATA_PFLAG_UNLOADING; @@ -6148,7 +6108,6 @@ static void ata_port_detach(struct ata_port *ap) cancel_delayed_work_sync(&ap->hotplug_task); cancel_delayed_work_sync(&ap->scsi_rescan_task); - skip_eh: /* clean up zpodd on port removal */ ata_for_each_link(link, ap, HOST_FIRST) { ata_for_each_dev(dev, link, ALL) { diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 35e03679b0bf..dc7857f9aa94 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -571,13 +571,10 @@ void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap, /* make sure sff pio task is not running */ ata_sff_flush_pio_task(ap); - if (!ap->ops->error_handler) - return; - /* synchronize with host lock and sort out timeouts */ /* - * For new EH, all qcs are finished in one of three ways - + * For EH, all qcs are finished in one of three ways - * normal completion, error completion, and SCSI timeout. * Both completions can race against SCSI timeout. When normal * completion wins, the qc never reaches EH. When error @@ -659,94 +656,89 @@ EXPORT_SYMBOL(ata_scsi_cmd_error_handler); void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap) { unsigned long flags; + struct ata_link *link; /* invoke error handler */ - if (ap->ops->error_handler) { - struct ata_link *link; - /* acquire EH ownership */ - ata_eh_acquire(ap); + /* acquire EH ownership */ + ata_eh_acquire(ap); repeat: - /* kill fast drain timer */ - del_timer_sync(&ap->fastdrain_timer); + /* kill fast drain timer */ + del_timer_sync(&ap->fastdrain_timer); - /* process port resume request */ - ata_eh_handle_port_resume(ap); + /* process port resume request */ + ata_eh_handle_port_resume(ap); - /* fetch & clear EH info */ - spin_lock_irqsave(ap->lock, flags); + /* fetch & clear EH info */ + spin_lock_irqsave(ap->lock, flags); - ata_for_each_link(link, ap, HOST_FIRST) { - struct ata_eh_context *ehc = &link->eh_context; - struct ata_device *dev; + ata_for_each_link(link, ap, HOST_FIRST) { + struct ata_eh_context *ehc = &link->eh_context; + struct ata_device *dev; - memset(&link->eh_context, 0, sizeof(link->eh_context)); - link->eh_context.i = link->eh_info; - memset(&link->eh_info, 0, sizeof(link->eh_info)); + memset(&link->eh_context, 0, sizeof(link->eh_context)); + link->eh_context.i = link->eh_info; + memset(&link->eh_info, 0, sizeof(link->eh_info)); - ata_for_each_dev(dev, link, ENABLED) { - int devno = dev->devno; + ata_for_each_dev(dev, link, ENABLED) { + int devno = dev->devno; - ehc->saved_xfer_mode[devno] = dev->xfer_mode; - if (ata_ncq_enabled(dev)) - ehc->saved_ncq_enabled |= 1 << devno; - } + ehc->saved_xfer_mode[devno] = dev->xfer_mode; + if (ata_ncq_enabled(dev)) + ehc->saved_ncq_enabled |= 1 << devno; } + } - ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS; - ap->pflags &= ~ATA_PFLAG_EH_PENDING; - ap->excl_link = NULL; /* don't maintain exclusion over EH */ + ap->pflags |= ATA_PFLAG_EH_IN_PROGRESS; + ap->pflags &= ~ATA_PFLAG_EH_PENDING; + ap->excl_link = NULL; /* don't maintain exclusion over EH */ - spin_unlock_irqrestore(ap->lock, flags); + spin_unlock_irqrestore(ap->lock, flags); - /* invoke EH, skip if unloading or suspended */ - if (!(ap->pflags & (ATA_PFLAG_UNLOADING | ATA_PFLAG_SUSPENDED))) - ap->ops->error_handler(ap); - else { - /* if unloading, commence suicide */ - if ((ap->pflags & ATA_PFLAG_UNLOADING) && - !(ap->pflags & ATA_PFLAG_UNLOADED)) - ata_eh_unload(ap); - ata_eh_finish(ap); - } + /* invoke EH, skip if unloading or suspended */ + if (!(ap->pflags & (ATA_PFLAG_UNLOADING | ATA_PFLAG_SUSPENDED))) + ap->ops->error_handler(ap); + else { + /* if unloading, commence suicide */ + if ((ap->pflags & ATA_PFLAG_UNLOADING) && + !(ap->pflags & ATA_PFLAG_UNLOADED)) + ata_eh_unload(ap); + ata_eh_finish(ap); + } - /* process port suspend request */ - ata_eh_handle_port_suspend(ap); + /* process port suspend request */ + ata_eh_handle_port_suspend(ap); - /* Exception might have happened after ->error_handler - * recovered the port but before this point. Repeat - * EH in such case. - */ - spin_lock_irqsave(ap->lock, flags); + /* + * Exception might have happened after ->error_handler recovered the + * port but before this point. Repeat EH in such case. + */ + spin_lock_irqsave(ap->lock, flags); - if (ap->pflags & ATA_PFLAG_EH_PENDING) { - if (--ap->eh_tries) { - spin_unlock_irqrestore(ap->lock, flags); - goto repeat; - } - ata_port_err(ap, - "EH pending after %d tries, giving up\n", - ATA_EH_MAX_TRIES); - ap->pflags &= ~ATA_PFLAG_EH_PENDING; + if (ap->pflags & ATA_PFLAG_EH_PENDING) { + if (--ap->eh_tries) { + spin_unlock_irqrestore(ap->lock, flags); + goto repeat; } + ata_port_err(ap, + "EH pending after %d tries, giving up\n", + ATA_EH_MAX_TRIES); + ap->pflags &= ~ATA_PFLAG_EH_PENDING; + } - /* this run is complete, make sure EH info is clear */ - ata_for_each_link(link, ap, HOST_FIRST) - memset(&link->eh_info, 0, sizeof(link->eh_info)); + /* this run is complete, make sure EH info is clear */ + ata_for_each_link(link, ap, HOST_FIRST) + memset(&link->eh_info, 0, sizeof(link->eh_info)); - /* end eh (clear host_eh_scheduled) while holding - * ap->lock such that if exception occurs after this - * point but before EH completion, SCSI midlayer will - * re-initiate EH. - */ - ap->ops->end_eh(ap); + /* + * end eh (clear host_eh_scheduled) while holding ap->lock such that if + * exception occurs after this point but before EH completion, SCSI + * midlayer will re-initiate EH. + */ + ap->ops->end_eh(ap); - spin_unlock_irqrestore(ap->lock, flags); - ata_eh_release(ap); - } else { - WARN_ON(ata_qc_from_tag(ap, ap->link.active_tag) == NULL); - ap->ops->eng_timeout(ap); - } + spin_unlock_irqrestore(ap->lock, flags); + ata_eh_release(ap); scsi_eh_flush_done_q(&ap->eh_done_q); @@ -912,8 +904,6 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; - WARN_ON(!ap->ops->error_handler); - qc->flags |= ATA_QCFLAG_EH; ata_eh_set_pending(ap, 1); @@ -934,8 +924,6 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc) */ void ata_std_sched_eh(struct ata_port *ap) { - WARN_ON(!ap->ops->error_handler); - if (ap->pflags & ATA_PFLAG_INITIALIZING) return; @@ -989,8 +977,6 @@ static int ata_do_link_abort(struct ata_port *ap, struct ata_link *link) struct ata_queued_cmd *qc; int tag, nr_aborted = 0; - WARN_ON(!ap->ops->error_handler); - /* we're gonna abort all commands, no need for fast drain */ ata_eh_set_pending(ap, 0); @@ -1065,8 +1051,6 @@ EXPORT_SYMBOL_GPL(ata_port_abort); */ static void __ata_port_freeze(struct ata_port *ap) { - WARN_ON(!ap->ops->error_handler); - if (ap->ops->freeze) ap->ops->freeze(ap); @@ -1091,8 +1075,6 @@ static void __ata_port_freeze(struct ata_port *ap) */ int ata_port_freeze(struct ata_port *ap) { - WARN_ON(!ap->ops->error_handler); - __ata_port_freeze(ap); return ata_port_abort(ap); @@ -1112,9 +1094,6 @@ void ata_eh_freeze_port(struct ata_port *ap) { unsigned long flags; - if (!ap->ops->error_handler) - return; - spin_lock_irqsave(ap->lock, flags); __ata_port_freeze(ap); spin_unlock_irqrestore(ap->lock, flags); @@ -1134,9 +1113,6 @@ void ata_eh_thaw_port(struct ata_port *ap) { unsigned long flags; - if (!ap->ops->error_handler) - return; - spin_lock_irqsave(ap->lock, flags); ap->pflags &= ~ATA_PFLAG_FROZEN; diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 85e279a12f62..99d4ab04bcce 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -1158,12 +1158,7 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc); */ int ata_sas_port_start(struct ata_port *ap) { - /* - * the port is marked as frozen at allocation time, but if we don't - * have new eh, we won't thaw it - */ - if (!ap->ops->error_handler) - ap->pflags &= ~ATA_PFLAG_FROZEN; + /* the port is marked as frozen at allocation time */ return 0; } EXPORT_SYMBOL_GPL(ata_sas_port_start); diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 370d18aca71e..dd427a6a3276 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -709,47 +709,6 @@ static void ata_qc_set_pc_nbytes(struct ata_queued_cmd *qc) qc->nbytes = scsi_bufflen(scmd) + qc->extrabytes; } -/** - * ata_dump_status - user friendly display of error info - * @ap: the port in question - * @tf: ptr to filled out taskfile - * - * Decode and dump the ATA error/status registers for the user so - * that they have some idea what really happened at the non - * make-believe layer. - * - * LOCKING: - * inherited from caller - */ -static void ata_dump_status(struct ata_port *ap, struct ata_taskfile *tf) -{ - u8 stat = tf->status, err = tf->error; - - if (stat & ATA_BUSY) { - ata_port_warn(ap, "status=0x%02x {Busy} ", stat); - } else { - ata_port_warn(ap, "status=0x%02x { %s%s%s%s%s%s%s} ", stat, - stat & ATA_DRDY ? "DriveReady " : "", - stat & ATA_DF ? "DeviceFault " : "", - stat & ATA_DSC ? "SeekComplete " : "", - stat & ATA_DRQ ? "DataRequest " : "", - stat & ATA_CORR ? "CorrectedError " : "", - stat & ATA_SENSE ? "Sense " : "", - stat & ATA_ERR ? "Error " : ""); - if (err) - ata_port_warn(ap, "error=0x%02x {%s%s%s%s%s%s", err, - err & ATA_ABORTED ? - "DriveStatusError " : "", - err & ATA_ICRC ? - (err & ATA_ABORTED ? - "BadCRC " : "Sector ") : "", - err & ATA_UNC ? "UncorrectableError " : "", - err & ATA_IDNF ? "SectorIdNotFound " : "", - err & ATA_TRK0NF ? "TrackZeroNotFound " : "", - err & ATA_AMNF ? "AddrMarkNotFound " : ""); - } -} - /** * ata_to_sense_error - convert ATA error to SCSI error * @id: ATA device number @@ -904,7 +863,6 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc) struct ata_taskfile *tf = &qc->result_tf; unsigned char *sb = cmd->sense_buffer; unsigned char *desc = sb + 8; - int verbose = qc->ap->ops->error_handler == NULL; u8 sense_key, asc, ascq; memset(sb, 0, SCSI_SENSE_BUFFERSIZE); @@ -916,7 +874,7 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc) if (qc->err_mask || tf->status & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) { ata_to_sense_error(qc->ap->print_id, tf->status, tf->error, - &sense_key, &asc, &ascq, verbose); + &sense_key, &asc, &ascq, false); ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq); } else { /* @@ -999,7 +957,6 @@ static void ata_gen_ata_sense(struct ata_queued_cmd *qc) struct scsi_cmnd *cmd = qc->scsicmd; struct ata_taskfile *tf = &qc->result_tf; unsigned char *sb = cmd->sense_buffer; - int verbose = qc->ap->ops->error_handler == NULL; u64 block; u8 sense_key, asc, ascq; @@ -1017,7 +974,7 @@ static void ata_gen_ata_sense(struct ata_queued_cmd *qc) if (qc->err_mask || tf->status & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) { ata_to_sense_error(qc->ap->print_id, tf->status, tf->error, - &sense_key, &asc, &ascq, verbose); + &sense_key, &asc, &ascq, false); ata_scsi_set_sense(dev, cmd, sense_key, asc, ascq); } else { /* Could not decode error */ @@ -1179,9 +1136,6 @@ void ata_scsi_slave_destroy(struct scsi_device *sdev) unsigned long flags; struct ata_device *dev; - if (!ap->ops->error_handler) - return; - spin_lock_irqsave(ap->lock, flags); dev = __ata_scsi_find_dev(ap, sdev); if (dev && dev->sdev) { @@ -1668,7 +1622,6 @@ static void ata_qc_done(struct ata_queued_cmd *qc) static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) { - struct ata_port *ap = qc->ap; struct scsi_cmnd *cmd = qc->scsicmd; u8 *cdb = cmd->cmnd; int need_sense = (qc->err_mask != 0) && @@ -1692,9 +1645,6 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) /* Keep the SCSI ML and status byte, clear host byte. */ cmd->result &= 0x0000ffff; - if (need_sense && !ap->ops->error_handler) - ata_dump_status(ap, &qc->result_tf); - ata_qc_done(qc); } @@ -2601,71 +2551,12 @@ static unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf) return 0; } -static void atapi_sense_complete(struct ata_queued_cmd *qc) -{ - if (qc->err_mask && ((qc->err_mask & AC_ERR_DEV) == 0)) { - /* FIXME: not quite right; we don't want the - * translation of taskfile registers into - * a sense descriptors, since that's only - * correct for ATA, not ATAPI - */ - ata_gen_passthru_sense(qc); - } - - ata_qc_done(qc); -} - /* is it pointless to prefer PIO for "safety reasons"? */ static inline int ata_pio_use_silly(struct ata_port *ap) { return (ap->flags & ATA_FLAG_PIO_DMA); } -static void atapi_request_sense(struct ata_queued_cmd *qc) -{ - struct ata_port *ap = qc->ap; - struct scsi_cmnd *cmd = qc->scsicmd; - - memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); - -#ifdef CONFIG_ATA_SFF - if (ap->ops->sff_tf_read) - ap->ops->sff_tf_read(ap, &qc->tf); -#endif - - /* fill these in, for the case where they are -not- overwritten */ - cmd->sense_buffer[0] = 0x70; - cmd->sense_buffer[2] = qc->tf.error >> 4; - - ata_qc_reinit(qc); - - /* setup sg table and init transfer direction */ - sg_init_one(&qc->sgent, cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); - ata_sg_init(qc, &qc->sgent, 1); - qc->dma_dir = DMA_FROM_DEVICE; - - memset(&qc->cdb, 0, qc->dev->cdb_len); - qc->cdb[0] = REQUEST_SENSE; - qc->cdb[4] = SCSI_SENSE_BUFFERSIZE; - - qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; - qc->tf.command = ATA_CMD_PACKET; - - if (ata_pio_use_silly(ap)) { - qc->tf.protocol = ATAPI_PROT_DMA; - qc->tf.feature |= ATAPI_PKT_DMA; - } else { - qc->tf.protocol = ATAPI_PROT_PIO; - qc->tf.lbam = SCSI_SENSE_BUFFERSIZE; - qc->tf.lbah = 0; - } - qc->nbytes = SCSI_SENSE_BUFFERSIZE; - - qc->complete_fn = atapi_sense_complete; - - ata_qc_issue(qc); -} - /* * ATAPI devices typically report zero for their SCSI version, and sometimes * deviate from the spec WRT response data format. If SCSI version is @@ -2691,9 +2582,8 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) struct scsi_cmnd *cmd = qc->scsicmd; unsigned int err_mask = qc->err_mask; - /* handle completion from new EH */ - if (unlikely(qc->ap->ops->error_handler && - (err_mask || qc->flags & ATA_QCFLAG_SENSE_VALID))) { + /* handle completion from EH */ + if (unlikely(err_mask || qc->flags & ATA_QCFLAG_SENSE_VALID)) { if (!(qc->flags & ATA_QCFLAG_SENSE_VALID)) { /* FIXME: not quite right; we don't want the @@ -2725,23 +2615,10 @@ static void atapi_qc_complete(struct ata_queued_cmd *qc) return; } - /* successful completion or old EH failure path */ - if (unlikely(err_mask & AC_ERR_DEV)) { - cmd->result = SAM_STAT_CHECK_CONDITION; - atapi_request_sense(qc); - return; - } else if (unlikely(err_mask)) { - /* FIXME: not quite right; we don't want the - * translation of taskfile registers into - * a sense descriptors, since that's only - * correct for ATA, not ATAPI - */ - ata_gen_passthru_sense(qc); - } else { - if (cmd->cmnd[0] == INQUIRY && (cmd->cmnd[1] & 0x03) == 0) - atapi_fixup_inquiry(cmd); - cmd->result = SAM_STAT_GOOD; - } + /* successful completion path */ + if (cmd->cmnd[0] == INQUIRY && (cmd->cmnd[1] & 0x03) == 0) + atapi_fixup_inquiry(cmd); + cmd->result = SAM_STAT_GOOD; ata_qc_done(qc); } @@ -4790,9 +4667,6 @@ int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, unsigned long flags; int devno, rc = 0; - if (!ap->ops->error_handler) - return -EOPNOTSUPP; - if (lun != SCAN_WILD_CARD && lun) return -EINVAL; diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 9d28badfe41d..84471d92cd1b 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c @@ -883,31 +883,21 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq) { struct ata_port *ap = qc->ap; - if (ap->ops->error_handler) { - if (in_wq) { - /* EH might have kicked in while host lock is - * released. - */ - qc = ata_qc_from_tag(ap, qc->tag); - if (qc) { - if (likely(!(qc->err_mask & AC_ERR_HSM))) { - ata_sff_irq_on(ap); - ata_qc_complete(qc); - } else - ata_port_freeze(ap); - } - } else { - if (likely(!(qc->err_mask & AC_ERR_HSM))) + if (in_wq) { + /* EH might have kicked in while host lock is released. */ + qc = ata_qc_from_tag(ap, qc->tag); + if (qc) { + if (likely(!(qc->err_mask & AC_ERR_HSM))) { + ata_sff_irq_on(ap); ata_qc_complete(qc); - else + } else ata_port_freeze(ap); } } else { - if (in_wq) { - ata_sff_irq_on(ap); - ata_qc_complete(qc); - } else + if (likely(!(qc->err_mask & AC_ERR_HSM))) ata_qc_complete(qc); + else + ata_port_freeze(ap); } } From patchwork Thu Jul 20 00:42:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 704871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5806EC001DC for ; Thu, 20 Jul 2023 00:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbjGTAqC (ORCPT ); Wed, 19 Jul 2023 20:46:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGTAqB (ORCPT ); Wed, 19 Jul 2023 20:46:01 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63EA61BF7; Wed, 19 Jul 2023 17:46:00 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fb5bcb9a28so322863e87.3; Wed, 19 Jul 2023 17:46:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689813959; x=1690418759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SS/+Rptd/CPkpo4GsV1LLONL5aRC92WpJNaX7mPRMY4=; b=GqG5KYJVeL7Gk8zPyaqmpwH3ZZ4QShO6aV5jkz7iHowRW2ggA2BXsjNqhyu8DMLDoU AoeUpioUuOnUcgM1gUeZZbSw/qFT5Afhw3m9Ae1iCMBkt4SrE7vc9STXC0PY6mAJEcXT vTMACtU47Z9/tEeP88642j7l2U98mLY82f1+ScDvmlwfHaTZX5QD/5cRye+ZIHMZdGSH 4sxHhx9ZBe/HLgE5vbMneX+Jpb1SF/4SwQ6rav9VwpmodAL9mlXbPcTQaaUiZZxKf0wS SxFu/UYZbeiFXyGgmuNAzG75h9G2m0ZB3g8kQxTm6sPE5Rk4OTRx2qdsOtZxHQ5ygwn7 UrCA== X-Gm-Message-State: ABy/qLZ4AzxpMoDaOnoDGBIyNGiGI9pQflPIl7l/B1yKQnakLW+S2YQc I+4ynfOd5Kvaiz1t8NBTDzzkt93cH7gZejKD X-Google-Smtp-Source: APBJJlGh2gQDHIqOE4iNT6pNu3HvU4B0lzhmScyAsxEoer3761Ym8FXWHEPAltPIXLBx9lc9mZImRA== X-Received: by 2002:a05:6512:2013:b0:4fb:92df:a27b with SMTP id a19-20020a056512201300b004fb92dfa27bmr1002558lfb.39.1689813958556; Wed, 19 Jul 2023 17:45:58 -0700 (PDT) Received: from flawful.org (c-f5f0e255.011-101-6d6c6d3.bbcust.telenor.se. [85.226.240.245]) by smtp.gmail.com with ESMTPSA id r1-20020a19ac41000000b004fbae51d1a5sm1170345lfc.295.2023.07.19.17.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 17:45:58 -0700 (PDT) Received: by flawful.org (Postfix, from userid 112) id 013073F11; Thu, 20 Jul 2023 02:45:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813957; bh=FxOOeXvaUA43cnXR6Mh91CQMDyAdV9tGoXL4WLcvyMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=refA2O+2f1TephaEZVDIS8bmBTtU6qraLhF75JCPZ4xOO6LlEJGxRo/OiKbrUpgib DQKxtR69jeyGC827KThm7qux9M5Lx6qlkHqD+mv8OlgYk2cMJ2AwNOv3UmtcLedvas jZutpw8O6JguwdGktXkPwuoomCBqJCDcG/YvyiKU= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id A7F8D3EF2; Thu, 20 Jul 2023 02:44:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813851; bh=FxOOeXvaUA43cnXR6Mh91CQMDyAdV9tGoXL4WLcvyMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N4pqJsaIVXkUvJEMyFwfaB0Q/hMinnkuXzlt/IhajNKTx+CxxKlIAbf9QQv6IiVcc ew2i/NTJFrUHfMu2jHdVLGMcdYkZqnLIOSiNNsu8CCR3wbz6slISYBqxSpKZj2DYMp TfhgsE4W4wS1hbp+mNweFBE2xNa0GgpGMZUl8J5o= From: Niklas Cassel To: Damien Le Moal , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Hannes Reinecke , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke , Niklas Cassel Subject: [PATCH v2 2/8] ata,scsi: remove ata_sas_port_{start,stop} callbacks Date: Thu, 20 Jul 2023 02:42:43 +0200 Message-ID: <20230720004257.307031-3-nks@flawful.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720004257.307031-1-nks@flawful.org> References: <20230720004257.307031-1-nks@flawful.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Hannes Reinecke Callbacks are empty now, so remove them. Signed-off-by: Hannes Reinecke Signed-off-by: Niklas Cassel --- drivers/ata/libata-sata.c | 34 ---------------------------------- drivers/scsi/libsas/sas_ata.c | 2 -- include/linux/libata.h | 2 -- 3 files changed, 38 deletions(-) diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 99d4ab04bcce..d3b595294eee 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -1144,40 +1144,6 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host, } EXPORT_SYMBOL_GPL(ata_sas_port_alloc); -/** - * ata_sas_port_start - Set port up for dma. - * @ap: Port to initialize - * - * Called just after data structures for each port are - * initialized. - * - * May be used as the port_start() entry in ata_port_operations. - * - * LOCKING: - * Inherited from caller. - */ -int ata_sas_port_start(struct ata_port *ap) -{ - /* the port is marked as frozen at allocation time */ - return 0; -} -EXPORT_SYMBOL_GPL(ata_sas_port_start); - -/** - * ata_sas_port_stop - Undo ata_sas_port_start() - * @ap: Port to shut down - * - * May be used as the port_stop() entry in ata_port_operations. - * - * LOCKING: - * Inherited from caller. - */ - -void ata_sas_port_stop(struct ata_port *ap) -{ -} -EXPORT_SYMBOL_GPL(ata_sas_port_stop); - /** * ata_sas_async_probe - simply schedule probing and return * @ap: Port to probe diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 77714a495cbb..7ead1f1be97f 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -565,8 +565,6 @@ static struct ata_port_operations sas_sata_ops = { .qc_prep = ata_noop_qc_prep, .qc_issue = sas_ata_qc_issue, .qc_fill_rtf = sas_ata_qc_fill_rtf, - .port_start = ata_sas_port_start, - .port_stop = ata_sas_port_stop, .set_dmamode = sas_ata_set_dmamode, .sched_eh = sas_ata_sched_eh, .end_eh = sas_ata_end_eh, diff --git a/include/linux/libata.h b/include/linux/libata.h index 820f7a3a2749..9424c490ef0b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1244,10 +1244,8 @@ extern struct ata_port *ata_sas_port_alloc(struct ata_host *, extern void ata_sas_async_probe(struct ata_port *ap); extern int ata_sas_sync_probe(struct ata_port *ap); extern int ata_sas_port_init(struct ata_port *); -extern int ata_sas_port_start(struct ata_port *ap); extern int ata_sas_tport_add(struct device *parent, struct ata_port *ap); extern void ata_sas_tport_delete(struct ata_port *ap); -extern void ata_sas_port_stop(struct ata_port *ap); extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *); extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap); extern void ata_tf_to_fis(const struct ata_taskfile *tf, From patchwork Thu Jul 20 00:42:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 705219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55E9BC001B0 for ; Thu, 20 Jul 2023 00:46:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjGTAqb (ORCPT ); Wed, 19 Jul 2023 20:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjGTAqa (ORCPT ); Wed, 19 Jul 2023 20:46:30 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1D0B1BF7; Wed, 19 Jul 2023 17:46:28 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fb41682472so333606e87.2; Wed, 19 Jul 2023 17:46:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689813987; x=1690418787; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LMxYZCpwMe5CgoARsL0Kt6uVRuwHpeG70NtCytqu8xk=; b=CSMJmDGn4jO3BG9Y4Ls7uOAjR9JZs6KehYykJ7tfazeVmPFhIT60YHoiO6Cu7GCUlW 3qTiaBSkgoW8Kz5HqOOT44KQZvCOET38NOfE5okRzD+PMkpaHfZbny+SL9xK8V3h6FBG EyblEsa7W4Aop9KLc6Ryp/VbzQiOC9+om0Q0MjfJRFN6qI4npk8l/SGiGpAe/mPv98UY Uvhog7a1ArkHvwLvShLM/1I2gj2BDxs1c9SU8KpFcTqFYeU1DaWAz1bx/ac+MlMQmYGf pNqEQfZ1PqIL9U9qNHwza/ZZoZZgUs/S97jCwlKg1c8UT93D+LtTsgkurjPhuI/ro+uV KsPg== X-Gm-Message-State: ABy/qLY6vF75z2OmgFc8XmWk0u+Wys1H6MXBrpbqts8SpSAfp52pmcSV 3T9uT5waJ2NsWwGa6IPlUBDXKlLnSa5UIBM5 X-Google-Smtp-Source: APBJJlHFH5ah4uTr811vcXFvIy4DUOZFesJXYz9h8CeD5Jnh1wfetDfMRxYBfkhG4ALswSc5AWZ/Xw== X-Received: by 2002:a05:6512:5c2:b0:4f8:651f:9bbe with SMTP id o2-20020a05651205c200b004f8651f9bbemr883742lfo.54.1689813987212; Wed, 19 Jul 2023 17:46:27 -0700 (PDT) Received: from flawful.org (c-f5f0e255.011-101-6d6c6d3.bbcust.telenor.se. [85.226.240.245]) by smtp.gmail.com with ESMTPSA id t4-20020ac25484000000b004fba759bf3asm1183643lfk.281.2023.07.19.17.46.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 17:46:27 -0700 (PDT) Received: by flawful.org (Postfix, from userid 112) id 95F303EF2; Thu, 20 Jul 2023 02:46:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813985; bh=xLsXb8Nm1LY+FElXFXs5W95JlfbHUBK2k8B15OjU8cE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAgfST4wBKH/NQwIGe661hQ8TkoB9hWHwoocle50aDo32JfSS/bBaTHLiUSTl80fe vrzbywEPHz7vXkD93qRvF+hM2A6avkYPqHrnHkLXBmhKlD3ysegF+z839ivP349yTV jJ1bXnhAulgWbBJNZEud0XSas+gOg6O1FDKM+0oc= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id DB18B3EF8; Thu, 20 Jul 2023 02:44:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813852; bh=xLsXb8Nm1LY+FElXFXs5W95JlfbHUBK2k8B15OjU8cE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ps7DlJae6uvy1WGeyTUh00LrvDq2HIjfmWifx7uJoSVLsxP95wGxjKCXKedlDw6FS RsR0vPTjERZntFEtW53OohF/F5b2pEtT7+aYKP6NK5FOwLN0YReL/XQw/p/TWvoov0 br5tcGW015v1nBzSLm+NeuYcLXqMe5lGfGto7gDI= From: Niklas Cassel To: Damien Le Moal , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Hannes Reinecke , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke , Niklas Cassel Subject: [PATCH v2 3/8] ata,scsi: remove ata_sas_port_destroy() Date: Thu, 20 Jul 2023 02:42:44 +0200 Message-ID: <20230720004257.307031-4-nks@flawful.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720004257.307031-1-nks@flawful.org> References: <20230720004257.307031-1-nks@flawful.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Hannes Reinecke Is now a wrapper around kfree(), so call it directly. Signed-off-by: Hannes Reinecke Signed-off-by: Niklas Cassel --- drivers/ata/libata-sata.c | 18 ------------------ drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_discover.c | 2 +- include/linux/libata.h | 1 - 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index d3b595294eee..b5de0f40ea25 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -1177,10 +1177,6 @@ EXPORT_SYMBOL_GPL(ata_sas_sync_probe); int ata_sas_port_init(struct ata_port *ap) { - int rc = ap->ops->port_start(ap); - - if (rc) - return rc; ap->print_id = atomic_inc_return(&ata_print_id); return 0; } @@ -1198,20 +1194,6 @@ void ata_sas_tport_delete(struct ata_port *ap) } EXPORT_SYMBOL_GPL(ata_sas_tport_delete); -/** - * ata_sas_port_destroy - Destroy a SATA port allocated by ata_sas_port_alloc - * @ap: SATA port to destroy - * - */ - -void ata_sas_port_destroy(struct ata_port *ap) -{ - if (ap->ops->port_stop) - ap->ops->port_stop(ap); - kfree(ap); -} -EXPORT_SYMBOL_GPL(ata_sas_port_destroy); - /** * ata_sas_slave_configure - Default slave_config routine for libata devices * @sdev: SCSI device to configure diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 7ead1f1be97f..a2eb9a2191c0 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -619,7 +619,7 @@ int sas_ata_init(struct domain_device *found_dev) return 0; destroy_port: - ata_sas_port_destroy(ap); + kfree(ap); free_host: ata_host_put(ata_host); return rc; diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 8c6afe724944..07e18cdb85c7 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -301,7 +301,7 @@ void sas_free_device(struct kref *kref) if (dev_is_sata(dev) && dev->sata_dev.ap) { ata_sas_tport_delete(dev->sata_dev.ap); - ata_sas_port_destroy(dev->sata_dev.ap); + kfree(dev->sata_dev.ap); ata_host_put(dev->sata_dev.ata_host); dev->sata_dev.ata_host = NULL; dev->sata_dev.ap = NULL; diff --git a/include/linux/libata.h b/include/linux/libata.h index 9424c490ef0b..53cfb1a4b97a 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1238,7 +1238,6 @@ extern int sata_link_debounce(struct ata_link *link, extern int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy, bool spm_wakeup); extern int ata_slave_link_init(struct ata_port *ap); -extern void ata_sas_port_destroy(struct ata_port *); extern struct ata_port *ata_sas_port_alloc(struct ata_host *, struct ata_port_info *, struct Scsi_Host *); extern void ata_sas_async_probe(struct ata_port *ap); From patchwork Thu Jul 20 00:42:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 704870 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28E3EC001DC for ; Thu, 20 Jul 2023 00:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjGTAql (ORCPT ); Wed, 19 Jul 2023 20:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbjGTAqk (ORCPT ); Wed, 19 Jul 2023 20:46:40 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71C951FFD; Wed, 19 Jul 2023 17:46:39 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4fbaef9871cso362537e87.0; Wed, 19 Jul 2023 17:46:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689813998; x=1690418798; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UFKqSI1dZOSejkI+CPMvjJBhoTp4XhKtY/ICFtgTOto=; b=U0R5QE6TrnaLXa6cAGAm5qWlSKE09Su5CzIZ20UnapyRzFrZ8UhiRFzjSUe+CddEtZ thvUZ9Mu+ztmITUqMxA92Lr4dduKCE8vIxJPAEoWyKtMSBGVjEa/eZ+iaeAFI/9p4BZg FfeRTre5UzVkXXs/r7SBlJTY0OIV0g+K8GRLALkj9tmPMK9dy17ZxAkoKgaFR5FObxzY rbkD3TvbTGZthhbpapkRFB6wLy9td0K+sByztuzjlQk8UgcxwJq0AXWgfcsED06hsTDS aq6o3sCRZ3Trfsr6i6dywkgqRg0iisG8UDGhqh+wJNXJWBSmvPS0+hcP3IPXhvW1pxZj /xYg== X-Gm-Message-State: ABy/qLY11h2xQ1IOzCKau2ZN4TZm2JZj1GSxtrsDzzVlH5IgOIWdoaYB PHDYuVAARNBmSGk8YzwuMrpug8a9OqxUX2mI X-Google-Smtp-Source: APBJJlGiRuOJ76WcFcb9IUftpexyWWRLSob980cB6GbrWIdPqjhSQJ171qR/VSAx8MgIZ09GMcC0aA== X-Received: by 2002:a05:6512:398d:b0:4f8:75bb:3301 with SMTP id j13-20020a056512398d00b004f875bb3301mr1316952lfu.20.1689813997584; Wed, 19 Jul 2023 17:46:37 -0700 (PDT) Received: from flawful.org (c-f5f0e255.011-101-6d6c6d3.bbcust.telenor.se. [85.226.240.245]) by smtp.gmail.com with ESMTPSA id t25-20020ac25499000000b004fbae25fcc4sm1197318lfk.61.2023.07.19.17.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 17:46:37 -0700 (PDT) Received: by flawful.org (Postfix, from userid 112) id 823773EF1; Thu, 20 Jul 2023 02:46:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813996; bh=rTVNoZ+0a+YA6IWcZMJinz17z2JRqQnxx1lIYO/NmU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OttbO2osSZz0xBSRsGp89n2hkKTL+JCm7JaMPbf0JMwmUUrWn6rveXuuGBTp8uui4 nmX9BKfojV66UGr8wuyAkqYgQ54IPJ1xw9y+uIBfprpaMFDCkJ9yim+6Zu96sEmwH0 Sz6p7EpLu4h3rZOadawDEVfek8exUqmkzQAPLBWM= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id 37B6B3EF3; Thu, 20 Jul 2023 02:44:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813853; bh=rTVNoZ+0a+YA6IWcZMJinz17z2JRqQnxx1lIYO/NmU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qxMuCpvQOiaoz4qD7RXSmilcZQXREZ/ACm87Hp5STYvLRwclnTAaKN62zH12338T7 Z7axUrQiEcauXsEE/4pypRJDtTU0eRXIbFzeJOerCrR+8meQ2tREqhyRjn9T3jx09E 4tWiNLFQMdKR7IaWrD4LIevnnzdepfQR6FqB9Tcc= From: Niklas Cassel To: Damien Le Moal Cc: Hannes Reinecke , John Garry , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke , Niklas Cassel Subject: [PATCH v2 4/8] ata: remove ata_sas_sync_probe() Date: Thu, 20 Jul 2023 02:42:45 +0200 Message-ID: <20230720004257.307031-5-nks@flawful.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720004257.307031-1-nks@flawful.org> References: <20230720004257.307031-1-nks@flawful.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Hannes Reinecke Unused. Signed-off-by: Hannes Reinecke Signed-off-by: Niklas Cassel --- drivers/ata/libata-sata.c | 7 ------- include/linux/libata.h | 1 - 2 files changed, 8 deletions(-) diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index b5de0f40ea25..23252ebe312d 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -1157,13 +1157,6 @@ void ata_sas_async_probe(struct ata_port *ap) } EXPORT_SYMBOL_GPL(ata_sas_async_probe); -int ata_sas_sync_probe(struct ata_port *ap) -{ - return ata_port_probe(ap); -} -EXPORT_SYMBOL_GPL(ata_sas_sync_probe); - - /** * ata_sas_port_init - Initialize a SATA device * @ap: SATA port to initialize diff --git a/include/linux/libata.h b/include/linux/libata.h index 53cfb1a4b97a..86490718cd0d 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1241,7 +1241,6 @@ extern int ata_slave_link_init(struct ata_port *ap); extern struct ata_port *ata_sas_port_alloc(struct ata_host *, struct ata_port_info *, struct Scsi_Host *); extern void ata_sas_async_probe(struct ata_port *ap); -extern int ata_sas_sync_probe(struct ata_port *ap); extern int ata_sas_port_init(struct ata_port *); extern int ata_sas_tport_add(struct device *parent, struct ata_port *ap); extern void ata_sas_tport_delete(struct ata_port *ap); From patchwork Thu Jul 20 00:42:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 705218 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 434F7C001DC for ; Thu, 20 Jul 2023 00:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjGTArG (ORCPT ); Wed, 19 Jul 2023 20:47:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjGTArG (ORCPT ); Wed, 19 Jul 2023 20:47:06 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11BA91BF7; Wed, 19 Jul 2023 17:47:05 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4fb7589b187so326148e87.1; Wed, 19 Jul 2023 17:47:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689814023; x=1690418823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mEX5QDv7Z54yUfmrfpPL3p1GUJhWKhMNNRkjdNIDE2w=; b=TswhdFFUJ0tLUS2Q/fEGncH9+uSkOlbwzSrsXF5lF4QZ5iLVhCunk547pFl1lOFb+w bPVu6Jm2CLdw0rIzCxymr9NgxcYdBW2Cj4Jl2AuoBQovyymu+ca3nDEkCmUaxH8aWRSI 5HqI4Ja8c+60sn6GL7MP0bTYNcqH9DyPMwEWFXQ4CJ474GoOyxpzQ9XrO7bfA91zovjR qKW9trUwyOFg9vR3G7sLS4CqYBGnB///+2J9djAZk1p7+8eMkvX0A+Vv3cwZb2i72hOy SNwzUxlre3pOJKTxfRvfPx5pULMkfh/ethwO8RBYm4sYCu/xYiWsRcQ6rQa6jrzuGCzS ohTQ== X-Gm-Message-State: ABy/qLbosABEWM/oeDqPycPakRFjdsD5DCQD7cCUrs3MT2ByzF+SPxkI e+cxZ2shWsYMha9oXQ32vWvDY8TJXWRQ85fp X-Google-Smtp-Source: APBJJlEktwqyxGEBUgwhu0XogKRZLxsUI+shgMOv25AJBGMGyKPOhqPitQKDXbcYawNcFxivNrsr7w== X-Received: by 2002:a05:6512:74:b0:4f9:710f:f3a9 with SMTP id i20-20020a056512007400b004f9710ff3a9mr924230lfo.58.1689814023291; Wed, 19 Jul 2023 17:47:03 -0700 (PDT) Received: from flawful.org (c-f5f0e255.011-101-6d6c6d3.bbcust.telenor.se. [85.226.240.245]) by smtp.gmail.com with ESMTPSA id c25-20020ac25319000000b004fb77d6cab3sm1185362lfh.261.2023.07.19.17.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 17:47:03 -0700 (PDT) Received: by flawful.org (Postfix, from userid 112) id 3E7F13EF3; Thu, 20 Jul 2023 02:47:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689814022; bh=7dtWz14fhEyUAO8Rh6eg1y8Xxl1vsOjRcR1BL43lw7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m3+tNffYYC2C19UboKpERU3J3LQw4Tp5D9tWv+H4VksyNX6rIWsGHtD3Olpo9b8m5 Z4JiuPO3AmRRk0ZLbBLNElKIBqrrCTZxnbVR+gxRhn8zYDCK9gMxtfxuqEg1LUOazR gGqGHcWMU8S06Jgfx6CRocFh5O0JVm1gdw/B5ZTk= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id 2858F3F0D; Thu, 20 Jul 2023 02:44:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813854; bh=7dtWz14fhEyUAO8Rh6eg1y8Xxl1vsOjRcR1BL43lw7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PwuxTiAr/rRDfTVCAQ6NTRrABb8+T5MZCMWsWVkYnWmnGu29hABIYbx1uQWDgA291 CW7mtJ5c0Qb6svfGJVQxYZcfQy5p3LBdLCcx5/CC9LzwkY16sghb1y3qxg4HTeQ8xO luKjrDFVhHKMK7LX3Cr/NxvNmhdO+l1C00zjBpvM= From: Niklas Cassel To: Damien Le Moal Cc: Hannes Reinecke , John Garry , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke , Niklas Cassel Subject: [PATCH v2 5/8] ata: inline ata_port_probe() Date: Thu, 20 Jul 2023 02:42:46 +0200 Message-ID: <20230720004257.307031-6-nks@flawful.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720004257.307031-1-nks@flawful.org> References: <20230720004257.307031-1-nks@flawful.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Hannes Reinecke Just used in one place. Signed-off-by: Hannes Reinecke Signed-off-by: Niklas Cassel --- drivers/ata/libata-core.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 1f0306522649..c5e93e1a560d 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5884,14 +5884,6 @@ void __ata_port_probe(struct ata_port *ap) spin_unlock_irqrestore(ap->lock, flags); } -int ata_port_probe(struct ata_port *ap) -{ - __ata_port_probe(ap); - ata_port_wait_eh(ap); - return 0; -} - - static void async_port_probe(void *data, async_cookie_t cookie) { struct ata_port *ap = data; @@ -5906,7 +5898,8 @@ static void async_port_probe(void *data, async_cookie_t cookie) if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0) async_synchronize_cookie(cookie); - (void)ata_port_probe(ap); + __ata_port_probe(ap); + ata_port_wait_eh(ap); /* in order to keep device order, we need to synchronize at this point */ async_synchronize_cookie(cookie); From patchwork Thu Jul 20 00:42:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 704869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E4B3C001DC for ; Thu, 20 Jul 2023 00:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbjGTAra (ORCPT ); Wed, 19 Jul 2023 20:47:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbjGTAr3 (ORCPT ); Wed, 19 Jul 2023 20:47:29 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 469282100; Wed, 19 Jul 2023 17:47:27 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4f954d7309fso381137e87.1; Wed, 19 Jul 2023 17:47:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689814045; x=1690418845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AnakjjiCvwFGg3Kp+5aoPO6lH+gF2137H/wko1LBoi8=; b=FfOvu4tNmVcX545f6eOFU709B8eGqIaKT/YEqSHRSqsy3zc39c/+K3eoVfGiE5bCUe 1jlgYYx4z1zeGmGqJfLZlkQUSgKmCke6E3TRecKdk801loWaywYsoG7KBw0inXje0Ex4 zGSnTK4ShUUKiWSHrZXHnyyEaZf7qeB3tkKN+Pg9Ej3afRhraViiCnoucHUuuejFgJ3k 6bTuaboj5AxLE2FLzaytUtfq4LMuXtWanNdimYD+gdK09w3cjbB1JoCiEgjarr7nV1Jy ZvkbdBwbdPT2mrB80MVumIcyU/v1zoMCtFwhin3cDCTuFq9+LRVMrR2CTnG6gg45Weg1 g5TA== X-Gm-Message-State: ABy/qLZSGoHM11n9LXJNtValBEGzUcyzUibnxOhUKEVpQLXd+vBF4QSl 2jy07hdWOIVxJDIUmfuNFxMKUch6Qa/YF5Us X-Google-Smtp-Source: APBJJlEd5yP+M9sZnfH6q+wtH+V9+8rZhVJ5O1KnmdNg9A+/f9a5fuNMm1xV4kW5nbZjfYRgrEsf5Q== X-Received: by 2002:a05:6512:754:b0:4f8:1e2a:1de1 with SMTP id c20-20020a056512075400b004f81e2a1de1mr387915lfs.29.1689814045446; Wed, 19 Jul 2023 17:47:25 -0700 (PDT) Received: from flawful.org (c-f5f0e255.011-101-6d6c6d3.bbcust.telenor.se. [85.226.240.245]) by smtp.gmail.com with ESMTPSA id a10-20020a056512020a00b004fdc7543ab9sm1178552lfo.229.2023.07.19.17.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 17:47:25 -0700 (PDT) Received: by flawful.org (Postfix, from userid 112) id 5BC953EF2; Thu, 20 Jul 2023 02:47:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689814044; bh=kctZLnduc1ey1L2S7SMv8ZYO5WBhHnUV5gxPYW/gxPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PkAUuXDXILrzvfJd4TBuMB35GhLkVY6zP+5sQk/ugWN4+i/Ox/q4wrZYCdbp/DTCC W8pcwhiuOXFPYdQEdD6c7Ow4hOnWavBrNglzxMsYrsp8jOO24ZNDXPjJIr8WkWbdzE YeezfSOrWD3/XMeK9EJW5mDfH5yiPbmLu/hmCPwg= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id 31D0C3F0A; Thu, 20 Jul 2023 02:44:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813855; bh=kctZLnduc1ey1L2S7SMv8ZYO5WBhHnUV5gxPYW/gxPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eDnDEOrp1BjYk8y4N15dyLJCMbx9b3Mw7lCdzhKT31PXnGvFEiy54aD4lLJXk1vTa CIg8lIOYmaRXLmjQDlAjTJ0elhGsrlyrQpCDvawKnhWAWLlRuV6xDOjuXNrGCOsEjH spOL82VF9GmuJygrWCYsJ9zu3pKNgV+7hMn+0ttw= From: Niklas Cassel To: Damien Le Moal , John Garry , Jason Yan , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Hannes Reinecke , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke , Niklas Cassel Subject: [PATCH v2 6/8] ata,scsi: cleanup ata_port_probe() Date: Thu, 20 Jul 2023 02:42:47 +0200 Message-ID: <20230720004257.307031-7-nks@flawful.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720004257.307031-1-nks@flawful.org> References: <20230720004257.307031-1-nks@flawful.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Hannes Reinecke Rename __ata_port_probe() to ata_port_probe() and drop the wrapper ata_sas_async_probe(). Signed-off-by: Hannes Reinecke Signed-off-by: Niklas Cassel --- drivers/ata/libata-core.c | 5 +++-- drivers/ata/libata-sata.c | 13 ------------- drivers/ata/libata.h | 2 -- drivers/scsi/libsas/sas_ata.c | 2 +- include/linux/libata.h | 2 +- 5 files changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c5e93e1a560d..dedae669c9da 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5865,7 +5865,7 @@ void ata_host_init(struct ata_host *host, struct device *dev, } EXPORT_SYMBOL_GPL(ata_host_init); -void __ata_port_probe(struct ata_port *ap) +void ata_port_probe(struct ata_port *ap) { struct ata_eh_info *ehi = &ap->link.eh_info; unsigned long flags; @@ -5883,6 +5883,7 @@ void __ata_port_probe(struct ata_port *ap) spin_unlock_irqrestore(ap->lock, flags); } +EXPORT_SYMBOL_GPL(ata_port_probe); static void async_port_probe(void *data, async_cookie_t cookie) { @@ -5898,7 +5899,7 @@ static void async_port_probe(void *data, async_cookie_t cookie) if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0) async_synchronize_cookie(cookie); - __ata_port_probe(ap); + ata_port_probe(ap); ata_port_wait_eh(ap); /* in order to keep device order, we need to synchronize at this point */ diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 23252ebe312d..c0253adbf47c 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -1144,19 +1144,6 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host, } EXPORT_SYMBOL_GPL(ata_sas_port_alloc); -/** - * ata_sas_async_probe - simply schedule probing and return - * @ap: Port to probe - * - * For batch scheduling of probe for sas attached ata devices, assumes - * the port has already been through ata_sas_port_init() - */ -void ata_sas_async_probe(struct ata_port *ap) -{ - __ata_port_probe(ap); -} -EXPORT_SYMBOL_GPL(ata_sas_async_probe); - /** * ata_sas_port_init - Initialize a SATA device * @ap: SATA port to initialize diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index cf993885d2b2..1ec9b4427b84 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h @@ -78,8 +78,6 @@ extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg); extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg); extern struct ata_port *ata_port_alloc(struct ata_host *host); extern const char *sata_spd_string(unsigned int spd); -extern int ata_port_probe(struct ata_port *ap); -extern void __ata_port_probe(struct ata_port *ap); extern unsigned int ata_read_log_page(struct ata_device *dev, u8 log, u8 page, void *buf, unsigned int sectors); diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index a2eb9a2191c0..d6bb37b3974a 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -653,7 +653,7 @@ void sas_probe_sata(struct asd_sas_port *port) if (!dev_is_sata(dev)) continue; - ata_sas_async_probe(dev->sata_dev.ap); + ata_port_probe(dev->sata_dev.ap); } mutex_unlock(&port->ha->disco_mutex); diff --git a/include/linux/libata.h b/include/linux/libata.h index 86490718cd0d..458cb24958ca 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1240,7 +1240,7 @@ extern int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy, extern int ata_slave_link_init(struct ata_port *ap); extern struct ata_port *ata_sas_port_alloc(struct ata_host *, struct ata_port_info *, struct Scsi_Host *); -extern void ata_sas_async_probe(struct ata_port *ap); +extern void ata_port_probe(struct ata_port *ap); extern int ata_sas_port_init(struct ata_port *); extern int ata_sas_tport_add(struct device *parent, struct ata_port *ap); extern void ata_sas_tport_delete(struct ata_port *ap); From patchwork Thu Jul 20 00:42:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 705217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E36D5C001DE for ; Thu, 20 Jul 2023 00:47:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbjGTArg (ORCPT ); Wed, 19 Jul 2023 20:47:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjGTArf (ORCPT ); Wed, 19 Jul 2023 20:47:35 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AA901BF7; Wed, 19 Jul 2023 17:47:34 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b9338e4695so2850841fa.2; Wed, 19 Jul 2023 17:47:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689814052; x=1690418852; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Uou6LBIfWMhwfme+l6VMfuCiY35xYiDS51Hd2okOGpY=; b=gbnSxRewkNmQEGEV3ieodwFcbIF88kcFsT1Od9yruFyfnSHPcBwfIduilP6mGLrYxp ImWy0ixuFo2fgDCiIz+n1YqTRHGvq5v1VcGUNXBnEnnfIhemh08ww+UVhs50b6sSFzd1 /5f2OzF6LJ1VK5H+B/2Rahch/rG9Nd54uFVKRyjJWVcJZLZqzPwiqDrsVU+bcNBzKzVQ MqXBBWaX1Uo23WYWbKFgErzlWEYMCHwV4a8cBJHzxbjRlCJ9v0ddS/7chcvNJpn9zzKx jVEMULhNhviU+Cm6hDAI3yjWSwrqXSQFgdp1JGgkjqBGefcRmOYkbImeb/IFy9PQmJCe r0Pg== X-Gm-Message-State: ABy/qLYItz6OBRKmBTPo6KpctJvVan3TgtpJjEg4v3Gy3pyNHr3kZ7c4 cm2vmfvhEqnveTABMJwu5fvoW8NNcDEIdlX3 X-Google-Smtp-Source: APBJJlEYq6pFdNJXkNbjqfls2hGfDkq/jp1yjJ+UT0Fw5loMnFLs/1mdtLhohp6d+XuhC6as1DUzrw== X-Received: by 2002:a2e:6e13:0:b0:2b6:e2c1:6cda with SMTP id j19-20020a2e6e13000000b002b6e2c16cdamr610736ljc.46.1689814052500; Wed, 19 Jul 2023 17:47:32 -0700 (PDT) Received: from flawful.org (c-f5f0e255.011-101-6d6c6d3.bbcust.telenor.se. [85.226.240.245]) by smtp.gmail.com with ESMTPSA id e15-20020a2e930f000000b002b6e3337fd5sm1285700ljh.7.2023.07.19.17.47.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 17:47:32 -0700 (PDT) Received: by flawful.org (Postfix, from userid 112) id 4B8F53EF1; Thu, 20 Jul 2023 02:47:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689814051; bh=GTatBvSlriM55n+5U4VYVyvnjmt3esNwCHNn3DmLhPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F/joq1c1Ahjewz6Rpx5MUfBb8PZvjImam80ZKnmVtuStnpm4inqgdJgmPy1XIs1Ai 8mZ/l13z2o8dZGLzA+cKyQtmcDlGS/OLbG/ZpYgUfXWUX67d0Ex/+PAM4ur4kVsuhv VMtw/6sv7CnAjsOUX69WO+s0lZuk2VNxngluCY3U= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id 17FF63F0E; Thu, 20 Jul 2023 02:44:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813856; bh=GTatBvSlriM55n+5U4VYVyvnjmt3esNwCHNn3DmLhPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nfQtURXNr7L/MqFCUFi3oY/Xc1pofVTaAiD2sgskAV+yi+twAQ6yMsu6hUyk4SkXp GEhoqbX5UyFLxq40f9sU4aiA4GT4LbGUQbI/F4QThzg5VqlfhM0B5jOBaaoeRVBxQY FWohFTL5UM0LJUru/eJX23Z2JV8vwsIej233kKDM= From: Niklas Cassel To: Damien Le Moal Cc: Hannes Reinecke , John Garry , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Niklas Cassel Subject: [PATCH v2 7/8] ata: sata_sx4: drop already completed TODO Date: Thu, 20 Jul 2023 02:42:48 +0200 Message-ID: <20230720004257.307031-8-nks@flawful.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720004257.307031-1-nks@flawful.org> References: <20230720004257.307031-1-nks@flawful.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Niklas Cassel The TODO claims that the pdc_20621_ops should set the .inherits function pointer to &ata_base_port_ops after it has been converted to use the new EH. However, the driver was converted to use the new EH a long time ago, in commit 67651ee5710c ("[libata] sata_sx4: convert to new exception handling methods"), which also did set .inherits function pointer to &ata_sff_port_ops (and ata_sff_port_ops itself has .inherits set to &ata_base_port_ops). Signed-off-by: Niklas Cassel --- drivers/ata/sata_sx4.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c index ccc016072637..b51d7a9d0d90 100644 --- a/drivers/ata/sata_sx4.c +++ b/drivers/ata/sata_sx4.c @@ -232,7 +232,6 @@ static const struct scsi_host_template pdc_sata_sht = { .dma_boundary = ATA_DMA_BOUNDARY, }; -/* TODO: inherit from base port_ops after converting to new EH */ static struct ata_port_operations pdc_20621_ops = { .inherits = &ata_sff_port_ops, From patchwork Thu Jul 20 00:42:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 704868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A8ECC001DE for ; Thu, 20 Jul 2023 00:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbjGTAro (ORCPT ); Wed, 19 Jul 2023 20:47:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjGTArn (ORCPT ); Wed, 19 Jul 2023 20:47:43 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D40D52106; Wed, 19 Jul 2023 17:47:41 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f954d7309fso381290e87.1; Wed, 19 Jul 2023 17:47:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689814060; x=1690418860; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PYJ05I8n5DhJbkESL91gXZT8SFoV1vMB4kWMK+SK8UA=; b=H6nz0fHn7CJGtSjUHEujFpw/u7i8m2CaSBxlGrYfaj0/pmMBjWTjndrtFtv/LMr2Qk SkMqTlaoOy6SRPB8mS4ItlXLProYj+I5WJW+IiVAjmlYd0Veo9NbTaARmGj7X5vuEAgj hkj1tpIhZ9n+CwsQAq37S4CtSUppK5uVabjA+yrqKxv19xox5nMyyQ0rKnPapqlbTwRk wR6OeoksryfHmvYQjGtXeT1mlGJwFOrIUZn8OkYi2nxcbbwm50B74NzzcnorwRtUWXgu 20kCPFfpTHU4UNDu9hvhwD+8yqzNVaRYJI3K9WNTk5hA0vCBMhy9G0JGXuVCODkCWo8f ++Pw== X-Gm-Message-State: ABy/qLZ2yMu5Vi7jgrx72HqkbFWyNti0dYEuC+G/7ncpZmbP5oJL9eGo 6phyvUQ4phzV4rFdi1NyAO50cINQBxqJBgSg X-Google-Smtp-Source: APBJJlEtKoVM3ANFTCrPFMQwLxnPiLK67lhPbjkiop+JHZ4sJp/9HWst6X59CMh3SV3wtKOWYfccqA== X-Received: by 2002:ac2:5599:0:b0:4f8:6d9d:abe0 with SMTP id v25-20020ac25599000000b004f86d9dabe0mr404169lfg.33.1689814059935; Wed, 19 Jul 2023 17:47:39 -0700 (PDT) Received: from flawful.org (c-f5f0e255.011-101-6d6c6d3.bbcust.telenor.se. [85.226.240.245]) by smtp.gmail.com with ESMTPSA id o30-20020ac2495e000000b004fc8049fc0dsm1179133lfi.82.2023.07.19.17.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 17:47:39 -0700 (PDT) Received: by flawful.org (Postfix, from userid 112) id E11BD4BD; Thu, 20 Jul 2023 02:47:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689814059; bh=EAb0dJXzCYxeykfA5FcCpAMDp5W96gKxySZLbumkKRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TZq6412qYYAqFa2rpSkcV5D2tdytWmPBJhpYl8/7O7oQX1i5/Qqn7FMRARkNP9JNH fqyr7EyM34eH5TDhpopfp5lwhjed6ZLx5EfIeP8VKEj6qPLN+Fp95mzUeOO5YAB9wh nqpLYc5244TgXodDlxitPABe9oIad/x9v/XdzaYg= Received: from x1-carbon.lan (OpenWrt.lan [192.168.1.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by flawful.org (Postfix) with ESMTPSA id 13FF73F0F; Thu, 20 Jul 2023 02:44:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flawful.org; s=mail; t=1689813857; bh=EAb0dJXzCYxeykfA5FcCpAMDp5W96gKxySZLbumkKRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LwjdUHVZbX9Cp7gxZ77Fm8SpLc6w9be6ZgcZANQ0+TZ8uW7q0VpgjsdqdOx++hRG8 HfxpGhEBcYo4SIxq9K27HKkKOKWi+vnmb4nLG167bkmqgui55OHCg+S+S2Sgnhkx/z z7u1/tfKLxIZOfwdihkSwNv5eCux4R7TTNEoK7Gg= From: Niklas Cassel To: Damien Le Moal Cc: Hannes Reinecke , John Garry , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Niklas Cassel Subject: [PATCH v2 8/8] ata: remove ata_bus_probe() Date: Thu, 20 Jul 2023 02:42:49 +0200 Message-ID: <20230720004257.307031-9-nks@flawful.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230720004257.307031-1-nks@flawful.org> References: <20230720004257.307031-1-nks@flawful.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Niklas Cassel Remove ata_bus_probe() as it is unused. Signed-off-by: Niklas Cassel --- drivers/ata/libata-core.c | 138 -------------------------------------- drivers/ata/libata.h | 1 - 2 files changed, 139 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index dedae669c9da..0af88ef231d1 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3057,144 +3057,6 @@ int ata_cable_sata(struct ata_port *ap) } EXPORT_SYMBOL_GPL(ata_cable_sata); -/** - * ata_bus_probe - Reset and probe ATA bus - * @ap: Bus to probe - * - * Master ATA bus probing function. Initiates a hardware-dependent - * bus reset, then attempts to identify any devices found on - * the bus. - * - * LOCKING: - * PCI/etc. bus probe sem. - * - * RETURNS: - * Zero on success, negative errno otherwise. - */ - -int ata_bus_probe(struct ata_port *ap) -{ - unsigned int classes[ATA_MAX_DEVICES]; - int tries[ATA_MAX_DEVICES]; - int rc; - struct ata_device *dev; - - ata_for_each_dev(dev, &ap->link, ALL) - tries[dev->devno] = ATA_PROBE_MAX_TRIES; - - retry: - ata_for_each_dev(dev, &ap->link, ALL) { - /* If we issue an SRST then an ATA drive (not ATAPI) - * may change configuration and be in PIO0 timing. If - * we do a hard reset (or are coming from power on) - * this is true for ATA or ATAPI. Until we've set a - * suitable controller mode we should not touch the - * bus as we may be talking too fast. - */ - dev->pio_mode = XFER_PIO_0; - dev->dma_mode = 0xff; - - /* If the controller has a pio mode setup function - * then use it to set the chipset to rights. Don't - * touch the DMA setup as that will be dealt with when - * configuring devices. - */ - if (ap->ops->set_piomode) - ap->ops->set_piomode(ap, dev); - } - - /* reset and determine device classes */ - ap->ops->phy_reset(ap); - - ata_for_each_dev(dev, &ap->link, ALL) { - if (dev->class != ATA_DEV_UNKNOWN) - classes[dev->devno] = dev->class; - else - classes[dev->devno] = ATA_DEV_NONE; - - dev->class = ATA_DEV_UNKNOWN; - } - - /* read IDENTIFY page and configure devices. We have to do the identify - specific sequence bass-ackwards so that PDIAG- is released by - the slave device */ - - ata_for_each_dev(dev, &ap->link, ALL_REVERSE) { - if (tries[dev->devno]) - dev->class = classes[dev->devno]; - - if (!ata_dev_enabled(dev)) - continue; - - rc = ata_dev_read_id(dev, &dev->class, ATA_READID_POSTRESET, - dev->id); - if (rc) - goto fail; - } - - /* Now ask for the cable type as PDIAG- should have been released */ - if (ap->ops->cable_detect) - ap->cbl = ap->ops->cable_detect(ap); - - /* We may have SATA bridge glue hiding here irrespective of - * the reported cable types and sensed types. When SATA - * drives indicate we have a bridge, we don't know which end - * of the link the bridge is which is a problem. - */ - ata_for_each_dev(dev, &ap->link, ENABLED) - if (ata_id_is_sata(dev->id)) - ap->cbl = ATA_CBL_SATA; - - /* After the identify sequence we can now set up the devices. We do - this in the normal order so that the user doesn't get confused */ - - ata_for_each_dev(dev, &ap->link, ENABLED) { - ap->link.eh_context.i.flags |= ATA_EHI_PRINTINFO; - rc = ata_dev_configure(dev); - ap->link.eh_context.i.flags &= ~ATA_EHI_PRINTINFO; - if (rc) - goto fail; - } - - /* configure transfer mode */ - rc = ata_set_mode(&ap->link, &dev); - if (rc) - goto fail; - - ata_for_each_dev(dev, &ap->link, ENABLED) - return 0; - - return -ENODEV; - - fail: - tries[dev->devno]--; - - switch (rc) { - case -EINVAL: - /* eeek, something went very wrong, give up */ - tries[dev->devno] = 0; - break; - - case -ENODEV: - /* give it just one more chance */ - tries[dev->devno] = min(tries[dev->devno], 1); - fallthrough; - case -EIO: - if (tries[dev->devno] == 1) { - /* This is the last chance, better to slow - * down than lose it. - */ - sata_down_spd_limit(&ap->link, 0); - ata_down_xfermask_limit(dev, ATA_DNXFER_PIO); - } - } - - if (!tries[dev->devno]) - ata_dev_disable(dev); - - goto retry; -} - /** * sata_print_link_status - Print SATA link status * @link: SATA link to printk link status about diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 1ec9b4427b84..6e7d352803bd 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h @@ -122,7 +122,6 @@ extern void ata_scsi_media_change_notify(struct ata_device *dev); extern void ata_scsi_hotplug(struct work_struct *work); extern void ata_schedule_scsi_eh(struct Scsi_Host *shost); extern void ata_scsi_dev_rescan(struct work_struct *work); -extern int ata_bus_probe(struct ata_port *ap); extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, unsigned int id, u64 lun); void ata_scsi_sdev_config(struct scsi_device *sdev);