Skip to content

Commit 89329c7

Browse files
Niklas Casseldamien-lemoal
authored andcommitted
ata: libata-core: remove ata_bus_probe()
Remove ata_bus_probe() as it is unused. Also, remove references to ata_bus_probe and port_disable in Documentation/driver-api/libata.rst, as neither exist anymore. Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Jason Yan <yanaijie@huawei.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent f810b81 commit 89329c7

4 files changed

Lines changed: 0 additions & 156 deletions

File tree

Documentation/driver-api/libata.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,6 @@ register blocks.
3232
:c:type:`struct ata_port_operations <ata_port_operations>`
3333
----------------------------------------------------------
3434

35-
Disable ATA port
36-
~~~~~~~~~~~~~~~~
37-
38-
::
39-
40-
void (*port_disable) (struct ata_port *);
41-
42-
43-
Called from :c:func:`ata_bus_probe` error path, as well as when unregistering
44-
from the SCSI module (rmmod, hot unplug). This function should do
45-
whatever needs to be done to take the port out of use. In most cases,
46-
:c:func:`ata_port_disable` can be used as this hook.
47-
48-
Called from :c:func:`ata_bus_probe` on a failed probe. Called from
49-
:c:func:`ata_scsi_release`.
50-
5135
Post-IDENTIFY device configuration
5236
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5337

drivers/ata/libata-core.c

Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,144 +3057,6 @@ int ata_cable_sata(struct ata_port *ap)
30573057
}
30583058
EXPORT_SYMBOL_GPL(ata_cable_sata);
30593059

3060-
/**
3061-
* ata_bus_probe - Reset and probe ATA bus
3062-
* @ap: Bus to probe
3063-
*
3064-
* Master ATA bus probing function. Initiates a hardware-dependent
3065-
* bus reset, then attempts to identify any devices found on
3066-
* the bus.
3067-
*
3068-
* LOCKING:
3069-
* PCI/etc. bus probe sem.
3070-
*
3071-
* RETURNS:
3072-
* Zero on success, negative errno otherwise.
3073-
*/
3074-
3075-
int ata_bus_probe(struct ata_port *ap)
3076-
{
3077-
unsigned int classes[ATA_MAX_DEVICES];
3078-
int tries[ATA_MAX_DEVICES];
3079-
int rc;
3080-
struct ata_device *dev;
3081-
3082-
ata_for_each_dev(dev, &ap->link, ALL)
3083-
tries[dev->devno] = ATA_PROBE_MAX_TRIES;
3084-
3085-
retry:
3086-
ata_for_each_dev(dev, &ap->link, ALL) {
3087-
/* If we issue an SRST then an ATA drive (not ATAPI)
3088-
* may change configuration and be in PIO0 timing. If
3089-
* we do a hard reset (or are coming from power on)
3090-
* this is true for ATA or ATAPI. Until we've set a
3091-
* suitable controller mode we should not touch the
3092-
* bus as we may be talking too fast.
3093-
*/
3094-
dev->pio_mode = XFER_PIO_0;
3095-
dev->dma_mode = 0xff;
3096-
3097-
/* If the controller has a pio mode setup function
3098-
* then use it to set the chipset to rights. Don't
3099-
* touch the DMA setup as that will be dealt with when
3100-
* configuring devices.
3101-
*/
3102-
if (ap->ops->set_piomode)
3103-
ap->ops->set_piomode(ap, dev);
3104-
}
3105-
3106-
/* reset and determine device classes */
3107-
ap->ops->phy_reset(ap);
3108-
3109-
ata_for_each_dev(dev, &ap->link, ALL) {
3110-
if (dev->class != ATA_DEV_UNKNOWN)
3111-
classes[dev->devno] = dev->class;
3112-
else
3113-
classes[dev->devno] = ATA_DEV_NONE;
3114-
3115-
dev->class = ATA_DEV_UNKNOWN;
3116-
}
3117-
3118-
/* read IDENTIFY page and configure devices. We have to do the identify
3119-
specific sequence bass-ackwards so that PDIAG- is released by
3120-
the slave device */
3121-
3122-
ata_for_each_dev(dev, &ap->link, ALL_REVERSE) {
3123-
if (tries[dev->devno])
3124-
dev->class = classes[dev->devno];
3125-
3126-
if (!ata_dev_enabled(dev))
3127-
continue;
3128-
3129-
rc = ata_dev_read_id(dev, &dev->class, ATA_READID_POSTRESET,
3130-
dev->id);
3131-
if (rc)
3132-
goto fail;
3133-
}
3134-
3135-
/* Now ask for the cable type as PDIAG- should have been released */
3136-
if (ap->ops->cable_detect)
3137-
ap->cbl = ap->ops->cable_detect(ap);
3138-
3139-
/* We may have SATA bridge glue hiding here irrespective of
3140-
* the reported cable types and sensed types. When SATA
3141-
* drives indicate we have a bridge, we don't know which end
3142-
* of the link the bridge is which is a problem.
3143-
*/
3144-
ata_for_each_dev(dev, &ap->link, ENABLED)
3145-
if (ata_id_is_sata(dev->id))
3146-
ap->cbl = ATA_CBL_SATA;
3147-
3148-
/* After the identify sequence we can now set up the devices. We do
3149-
this in the normal order so that the user doesn't get confused */
3150-
3151-
ata_for_each_dev(dev, &ap->link, ENABLED) {
3152-
ap->link.eh_context.i.flags |= ATA_EHI_PRINTINFO;
3153-
rc = ata_dev_configure(dev);
3154-
ap->link.eh_context.i.flags &= ~ATA_EHI_PRINTINFO;
3155-
if (rc)
3156-
goto fail;
3157-
}
3158-
3159-
/* configure transfer mode */
3160-
rc = ata_set_mode(&ap->link, &dev);
3161-
if (rc)
3162-
goto fail;
3163-
3164-
ata_for_each_dev(dev, &ap->link, ENABLED)
3165-
return 0;
3166-
3167-
return -ENODEV;
3168-
3169-
fail:
3170-
tries[dev->devno]--;
3171-
3172-
switch (rc) {
3173-
case -EINVAL:
3174-
/* eeek, something went very wrong, give up */
3175-
tries[dev->devno] = 0;
3176-
break;
3177-
3178-
case -ENODEV:
3179-
/* give it just one more chance */
3180-
tries[dev->devno] = min(tries[dev->devno], 1);
3181-
fallthrough;
3182-
case -EIO:
3183-
if (tries[dev->devno] == 1) {
3184-
/* This is the last chance, better to slow
3185-
* down than lose it.
3186-
*/
3187-
sata_down_spd_limit(&ap->link, 0);
3188-
ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
3189-
}
3190-
}
3191-
3192-
if (!tries[dev->devno])
3193-
ata_dev_disable(dev);
3194-
3195-
goto retry;
3196-
}
3197-
31983060
/**
31993061
* sata_print_link_status - Print SATA link status
32003062
* @link: SATA link to printk link status about

drivers/ata/libata.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ extern void ata_scsi_media_change_notify(struct ata_device *dev);
122122
extern void ata_scsi_hotplug(struct work_struct *work);
123123
extern void ata_schedule_scsi_eh(struct Scsi_Host *shost);
124124
extern void ata_scsi_dev_rescan(struct work_struct *work);
125-
extern int ata_bus_probe(struct ata_port *ap);
126125
extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
127126
unsigned int id, u64 lun);
128127
void ata_scsi_sdev_config(struct scsi_device *sdev);

include/linux/libata.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ enum {
344344
ATA_LINK_RESUME_TRIES = 5,
345345

346346
/* how hard are we gonna try to probe/recover devices */
347-
ATA_PROBE_MAX_TRIES = 3,
348347
ATA_EH_DEV_TRIES = 3,
349348
ATA_EH_PMP_TRIES = 5,
350349
ATA_EH_PMP_LINK_TRIES = 3,

0 commit comments

Comments
 (0)